﻿using System;
using System.Web.UI;
using Model;
using Business;




namespace WebApplication
{
    public partial class _Default : System.Web.UI.Page
    {
        
        Employee employee = null;

        protected void Page_Load(object sender, EventArgs e)
        {
            
        }

        protected void btnShowTimesheet_Click(object sender, ImageClickEventArgs e)
        {
            int empId = int.Parse(txtId.Text);
            employee = EmployeeMngr.getEmployeeById(empId);
            this.lblEmployeeName.Text = employee.lastname + ", " + employee.name;
            ViewState["Employee"] = employee;

            grvTimesheet.AutoGenerateColumns = false;

            

            //this.grvTimesheet.DataSource = TimesheetMngr.getTimesheetLast7Days((Employee)ViewState["Employee"]);
            //this.grvTimesheet.DataSource = TimesheetMngr.getTimesheetLast7Days(empId);
            this.grvTimesheet.DataBind();

           
        }

        protected void btnSign_Click(object sender, ImageClickEventArgs e)
        {
           // TimesheetMngr.sign((Employee) ViewState["Employee"], ddlSignType.SelectedValue, "192.168.1.1");
        }





    }
}
